/**
* @file			This s the main file of the relay status and change code
* @author  		Salina Joseph - student ID = st20000439
* @version 		1.0
* @date    		December 2014
* @brief   		Template code for main program.
*/

/* Includes ------------------------------------------------------------------*/
#include "arduino.h"
int ON_OFF;
int PIN;

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/


/**
* @brief	The setup() function will only run once, after each powerup or reset of the board. Use it to initialize variables, pin modes, start using libraries, etc.
* @param	None
* @retval	None
*/
void setup()
{
	pinMode(13, OUTPUT);
}


/**
* @brief	The loop() function does loop consecutively checking every caseand if default it will end
* @param	None
* @retval	None
*/


void relay_changeAndStatus(unsigned int ROOM_NO){
	
	
switch (ROOM_NO)
  {
  case 'A': PIN = 13; break;
  case 'B': PIN = 12; break;
  case 'C': PIN = 8; break;
  case 'D': PIN = 7; break;
  case 'E': PIN = 4; break;
  case 'F': PIN = 3; break;
  case 'G': PIN = 2; break;
  case 'H': PIN = 5; break;
		default: PIN = 1; break;
  }
	
	
	
	
}

void loop()
{
	//int val = digitalRead(2);
	ON_OFF = 1;
	
	relay_changeAndStatus('B');
	
	digitalWrite(13, ON_OFF);
	
}

/**
* @brief	The main function
* @param	None
* @retval	None
*/
int main() 
{
	platform_config();
	setup();
	while(1) {
		loop();
	}
}
